using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Elo.Exemplo.EFCodeFirst.Domain.Entities;

namespace Elo.Exemplo.EFCodeFirst.Domain.Mapping
{
	public class Product_Sales_for_1997Map : EntityTypeConfiguration<Product_Sales_for_1997>
	{
		public Product_Sales_for_1997Map()
		{
			// Primary Key
			this.HasKey(t => new { t.CategoryName, t.ProductName });

			// Properties
			this.Property(t => t.CategoryName)
				.IsRequired()
				.HasMaxLength(15);
				
			this.Property(t => t.ProductName)
				.IsRequired()
				.HasMaxLength(40);
				
			// Table & Column Mappings
			this.ToTable("Product Sales for 1997");
			this.Property(t => t.CategoryName).HasColumnName("CategoryName");
			this.Property(t => t.ProductName).HasColumnName("ProductName");
			this.Property(t => t.ProductSales).HasColumnName("ProductSales");
		}
	}
}

